#ifndef NEWS_H
#define NEWS_H
#include <string>
#include <vector>
#include "article.h"
#include <unordered_map>


class newsgroup{
	public:
	newsgroup(int id, std::string title):groupid(id), title(title){
		nextarticleid = 0;
	}
	
	std::string gettitle(){
		return title;
	}
	
	int nextidtobeused(){return nextarticleid + 1;}
	
	std::vector<std::pair<int, std::string>> getarticlenames();
	std::pair<int, article> getarticle(int articleid);
	int getid(){
		return groupid;
	}
	
	void addarticle(std::string title, std::string author, std::string text);
	
	bool deletearticle(int articleid);
	
	private:
	int groupid;
	std::string title;
	std::unordered_map<int, article> articles;
	int nextarticleid;
};

#endif